package cn.masterj.springcloud;

import cn.ribbon.rule.MyRule;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.ribbon.RibbonClient;

/**
 * @author masterJ
 * @create 2020-04-03 10:26
 */
@SpringBootApplication
@EnableEurekaClient
@EnableDiscoveryClient
/**
 * ribbon使用自定义的负载均衡策略，name一定要指定是针对哪个服务使用自定义的负载均衡策略，否则无效
 */
@RibbonClient(configuration = MyRule.class, name = "CLOUD-PROVIDER-PAYMENT")
public class CloudConsumerOrder8080Application {

    public static void main(String[] args) {
        SpringApplication.run(CloudConsumerOrder8080Application.class);
    }
}
